package com.sfdcj.se.util;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

public class Utils {

	static public List<String> getParamsWithKeywords(HttpServletRequest req,
			String key) {
		List<String> list = new ArrayList<String>();

		Iterator<String> itr = req.getParameterMap().keySet().iterator();
		while (itr.hasNext()) {
			String val = (String) itr.next();
			if (!val.startsWith(key))
				continue;
			list.add(val);
		}

		return list;
	}

	static public String getParameter(HttpServletRequest req, String key) {
		return req.getParameter(key);
	}
	
}
